module.exports = class extends think.Controller {
	async __before() {
		console.log(this.isWeixin());
		if(!this.isWeixin()) {
			return this.fail("请用微信浏览器打开");
		}
//this.session('user',{user_id:1});

		let user = await this.session('user');

		if(think.isEmpty(user)) {
			this.cookie('weixinUrl', this.ctx.url);
			return this.redirect('/app/wxmp/oauth/index');
		}

	}
};